package com.iyohei.mapper;


import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import com.iyohei.entry.Comment;

@Mapper
public interface CommentMapper {
	
	@Select("select * from comment where blog_id = #{id}")
	public List<Comment> getComList(long id);
	
	@Insert("INSERT INTO comment (blog_id,comment_name,comment_number,comment_note,comment_time) values(#{blogId},#{commentName},#{commentNumber},#{commentNote},#{commentTime})  ")
//	 @Options(useGeneratedKeys=true, keyProperty="com.id", keyColumn="com.id")
	public int addComment(Comment com);
	
	@Select("select * from comment where id = #{id}")
	public Comment getCommentById(long id);
	
}
